﻿using System;
using Shell.Build;

namespace Shell.Ioc
{
    class BuildPlanExecutor : IBuilder
    {
        public void PreBuild(IBuildContext context)
        {
            if (context.Output == null)
            {
                var plan = context.Policies.Get<IBuildPlan>(context.Identity);
                if (plan != null)
                {
                    plan.Execute();
                }
            }
        }

        public void PostBuild(IBuildContext context)
        {
        }
    }
}
